package io.kiki.stack.netty;

import io.kiki.stack.netty.command.CommandCode;
import io.kiki.stack.netty.config.Config;
import io.kiki.stack.netty.lifeCycle.LifeCycle;
import io.kiki.stack.netty.processor.Processor;
import io.kiki.stack.netty.userProcessor.UserProcessor;

import java.util.concurrent.Executor;

public interface IServer extends Config, LifeCycle {

    @Deprecated
    void init();

    /**
     * Start the server. Use startup() instead.
     */
    @Deprecated
    boolean start();

    @Deprecated
    boolean stop();


    String ip();

    int port();


    void registerProcessor(byte protocolCode, CommandCode commandCode, Processor<?> processor);


    void registerDefaultExecutor(byte protocolCode, Executor executor);


    void registerUserProcessor(UserProcessor<?> userProcessor);

}
